package zy.gongxiang.pucharse.dataobject;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * @Auther: zhangy
 * @Date: 2018/9/17 11:01
 * @Description:
 */
public class UdcPK implements Serializable {
    private String productCode;
    private String userdefinedCode;
    private String detailCode;

    @Column(name = "product_code")
    @Id
    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    @Column(name = "userdefined_code")
    @Id
    public String getUserdefinedCode() {
        return userdefinedCode;
    }

    public void setUserdefinedCode(String userdefinedCode) {
        this.userdefinedCode = userdefinedCode;
    }

    @Column(name = "detail_code")
    @Id
    public String getDetailCode() {
        return detailCode;
    }

    public void setDetailCode(String detailCode) {
        this.detailCode = detailCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UdcPK udcPK = (UdcPK) o;
        return Objects.equals(productCode, udcPK.productCode) &&
                Objects.equals(userdefinedCode, udcPK.userdefinedCode) &&
                Objects.equals(detailCode, udcPK.detailCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productCode, userdefinedCode, detailCode);
    }
}
